import Vue from 'vue'
import VueRouter from "vue-router";
import App from './App.vue'
//组件
import Home from "@/pages/Home.vue";
import About from "@/pages/About.vue";
import UserList from "@/pages/UserList.vue";
import NewsList from "@/pages/NewsList.vue";
import Car from "@/pages/Car.vue";
import Book from "@/pages/Book.vue";
import Phone from "@/pages/Phone.vue";
import NotFound from "@/pages/NotFound.vue";

Vue.config.productionTip = false
Vue.use(VueRouter);
new Vue({
  router:new VueRouter({
    mode:"history",
    base:'m',
    routes:[
      {
        path:'/home',
        component:Home
      },
      {
        path:'/about',
        alias:'/ab',
        component:About
      },
      {
        path:'/userlist',
        redirect:'/user',
      },
      {
        path:'/user',
        component:UserList
      },
      {
        path:'/newslist',
        alias:['/one','/two'],
        component:NewsList
      },
      {
        path:'/goodslist',
        components:{
          Car,
          Book,
          default:Phone
        }
      },
      {
        path:"*",
        component:NotFound
      }
    ]
  }),
  render: h => h(App),
}).$mount('#app')
